package rs.pnv.model;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;

import org.hibernate.validator.constraints.NotBlank;

@Entity
@Table(name = "PCC_AUTHS")
@XmlAccessorType(XmlAccessType.FIELD)
public class CardAuthenticationRequest extends AbstractEntity {
	
	@NotBlank
	@Column(nullable = false)
	@XmlElement(nillable = false)
	private String pan;

	@NotBlank
	@Column(nullable = false)
	@XmlElement(nillable = false)
	private String securityCode;

	@NotBlank
	@Column(nullable = false)
	@XmlElement(nillable = false)
	private String cardHolderName;

	@NotBlank
	@Column(nullable = false)
	@XmlElement(nillable = false)
	private Date expirationDate;
	
	@NotBlank
	@Column(nullable = false)
	@XmlElement(nillable = false)
	private BigDecimal amount;	
	
	@NotBlank
	@Column(nullable = false)
	@XmlElement(nillable = false)
	private BigInteger acqOrderId;
	
	@NotNull
	@Column(nullable = false, updatable = false)
	private Date acqTimestamp;

	public CardAuthenticationRequest() {

	}	

	public CardAuthenticationRequest(String pan, String securityCode,
			String cardHolderName, Date expirationDate, BigDecimal amount, BigInteger acqOrderId,
			Date acqTimestamp) {
		super();
		this.pan = pan;
		this.securityCode = securityCode;
		this.cardHolderName = cardHolderName;
		this.expirationDate = expirationDate;
		this.amount = amount;
		this.acqOrderId = acqOrderId;
		this.acqTimestamp = acqTimestamp;
	}



	public String getPan() {
		return pan;
	}

	public void setPan(String pan) {
		this.pan = pan;
	}

	public String getSecurityCode() {
		return securityCode;
	}

	public void setSecurityCode(String securityCode) {
		this.securityCode = securityCode;
	}

	public String getCardHolderName() {
		return cardHolderName;
	}

	public void setCardHolderName(String cardHolderName) {
		this.cardHolderName = cardHolderName;
	}

	public Date getExpirationDate() {
		return expirationDate;
	}

	public void setExpirationDate(Date expirationDate) {
		this.expirationDate = expirationDate;
	}

	public BigInteger getAcqOrderId() {
		return acqOrderId;
	}

	public void setAcqOrderId(BigInteger acqOrderId) {
		this.acqOrderId = acqOrderId;
	}

	public Date getAcqTimestamp() {
		return acqTimestamp;
	}

	public void setAcqTimestamp(Date acqTimestamp) {
		this.acqTimestamp = acqTimestamp;
	}

	public BigDecimal getAmount() {
		return amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

}
